﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Dora.Services.AdminUser.Dto.ViewDto
{
    /// <summary>
    /// 最近门店信息结果集
    /// </summary>
    public class NearestStoreOrgDto
    {
        /// <summary>
        /// 组织机构Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 组织机构名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 简称
        /// </summary>
        public string ShortName { get; set; }
        /// <summary>
        /// 门店或者总社直属门店
        /// </summary>
        public int OrgLevel { get; set; }

        /// <summary>
        /// 【门店】门面照片
        /// </summary>
        public string StorePhoto { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string LeaderPhone { get; set; }
        /// 详细地址
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 层级路径;从最祖宗到本级,英文逗号分隔
        /// </summary>
        public string LevelPath { get; set; }

        /// <summary>
        /// 该门店距离当前位置的距离（单位:米）
        /// </summary>
        public decimal Distance { get; set; }

        /// <summary>
        /// 该门店距离当前位置的人性化距离
        /// </summary>
        public string DistanceText
        {
            get
            {
                if (Distance >0&&Distance < 1000)
                {
                    return $"{Distance}米";
                }
                else if (Distance >= 1000 && Distance < 100 * 1000)
                {
                    return $"{(Distance / 1000).ToString("F1")}千米";
                }
                else
                {
                    return $">100千米";
                }
            }
        }
    }
}
